package com.ve.usb;

import com.ve.downloader.BufferSerial;

public class UsbSerialAdapter extends BufferSerial {
    private static final String TAG = UsbSerialAdapter.class.getSimpleName();

    private SerialService serial;
    public UsbSerialAdapter(SerialService serial) {
        this.serial = serial;

    }

    @Override
    public void setBaudrate(int baudrate) {
        serial.setBaudRate(baudrate);

    }

    @Override
    public int getBaudrate() {
        return serial.getBaudRate();
    }

    @Override
    public int read(byte[] buff, int size) {
        return serial.read(buff, size);
    }

    @Override
    public void write(byte[] bytes) {
        serial.write(bytes, bytes.length);
    }


    @Override
    public void setParity(boolean parity) {
    }

    @Override
    public void close() {
        serial.close();
    }
}